﻿using System;
using System.Windows.Data;
using System.Globalization;
using DACU.VkontakteApi.Enums;

namespace DACU.Tools.Converters
{
	class EmptyToN_AConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value is string)
			{
				string s = value as string;
				if (string.IsNullOrEmpty(s)) return "N/A";
				return s;
			}
			else
				if (value is VKSex)
				{
					var s = (VKSex)value;
					return s == VKSex.None ? "N/A" : s.ToString();
				}
			return null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}

}
